@extends('layouts.web')

@section('title', $article->title.' - '.$art_col->title.' - '.env('APP_NAME').'资讯--不一样的资讯网站 - '.env('APP_NAME').' - 我们只推荐好文章')
@section('keywords', $article->keywords)
@section('description', $article->description)

@section('content')
    <div class="main-container">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md8">
                <div class="layui-card">
                    <div class="layui-card-header none-border">
                        <div class="layui-breadcrumb" style="visibility: visible;">
                            <a href="{{ url('/') }}">首页</a>
                            <span lay-separator="">/</span>
                            <a href="{{ url('/article/'.$art_col->id) }}/" target="_blank">{{ $art_col->title }}</a>
                            <span lay-separator="">/</span>
                            <a>
                                <cite>正文</cite>
                            </a>
                        </div>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-header site-info-top site-padding article-info">
                        <h2>{{ $article->title }}</h2>
                        <div class="article-meta">
                            <span>发布时间：{{ $article->created_at }}</span>
                            @if($article->copy_from)
                                @php
                                    $copy_from  = explode('|',$article->copy_from);
                                @endphp
                                <span>内容来源：<a href="{{ $copy_from[1] }}" target="_blank">{{ $copy_from[0] }}</a></span>
                            @endif
                            <span>阅读数：<em id="views">{{ $article->views }}</em></span>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <div class="article-content">
                            {!! $article->content !!}
                        </div>
                        @if($article->keywords)
                            <div class="tags">
                                <span class="tag">标签：</span>
                                @foreach(explode(',',$article->keywords) as $v)
                                    <a href="{{ url('search/article/'.$v) }}/" target="_blank">
                                        {{ $v }}
                                    </a>
                                @endforeach
                            </div>
                        @endif
                    </div>
                    <div class="layui-card-body prev-next">
                        @if($prev)
                            <div class="prev">
                                上一站点：
                                <a href="{{ url('/artinfo-'.$prev->id.'.html') }}" class="prev-next-a" title="{{ $prev->title }}">
                                    {{ str_limit($prev->title,25,'……') }}
                                </a>
                            </div>
                        @else
                            <div class="prev">
                                上一站点：
                                没有了更多站点了……
                            </div>
                        @endif
                            @if($next)
                                <div class="next">
                                    下一站点：
                                    <a href="{{ url('/artinfo-'.$next->id.'.html') }}" class="prev-next-a" title="{{ $next->title }}">
                                        {{ str_limit($next->title,25,'……') }}
                                    </a>
                                </div>
                            @else
                                <div class="next">
                                    下一站点：
                                    没有了更多站点了……
                                </div>
                            @endif
                    </div>
                </div>
                @if($article_list)
                    <div class="layui-card">
                        <div class="layui-card-header">相关文章</div>
                        <div class="layui-card-body site-list-body article-list-relevant">
                            <ul>
                                @foreach($article_list as $v)
                                    <li>
                                        <a href="{{ url('/artinfo-'.$v->id.'.html') }}" title="{{ $v->title }}">
                                            {{ str_limit($v->title,40,'……') }}
                                        </a>
                                        <span>{{ $v->updated_at->format('m-d') }}</span>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                @endif
            </div>
            <div class="layui-col-md4">
                @include('layouts.right')
            </div>
        </div>
    </div>
@endsection
